// CommonJS polyfill for Vite development environment
// 为 Vite 开发环境提供 CommonJS 模块支持

if (typeof window !== 'undefined') {
  // 在浏览器环境中创建 CommonJS 兼容对象
  if (typeof window.exports === 'undefined') {
    window.exports = {};
  }
  
  if (typeof window.module === 'undefined') {
    window.module = { 
      exports: window.exports 
    };
  }
  
  // 将 exports 和 module 也挂载到 globalThis
  if (typeof globalThis !== 'undefined') {
    if (typeof globalThis.exports === 'undefined') {
      globalThis.exports = window.exports;
    }
    
    if (typeof globalThis.module === 'undefined') {
      globalThis.module = window.module;
    }
  }
  
  console.log('CommonJS polyfill loaded for Vite development environment');
}

